
<div id="min-height" style="min-height: 630px; height: 814px;"><div class="w980 pb90 fc minHeight">



    <div class="w220 bg_gray fl  pt30 tac pos_r">

        <a href="{:U('Index/Customer/face')}">
            <img title="点击头像编辑" src="__ROOT__{$userInfo['face']}" class="img-circular" height="200" width="200">
        </a>
        <h4 class="lh26 ft24 pt10">{$userInfo['username']}</h4>

        <div class="pb10 pt10 bottom-border-white">
            <a class="btn btn_gray3" href="{:U('Index/Customer/index')}">
                <span class="btn_lft"></span>
                <span class="btn_mid ">个人设置</span>
                <span class="btn_rgt"></span>
            </a>
            <a class="btn btn_gray3" href="{:U('Index/Customer/password')}">
                <span class="btn_lft"></span>
                <span class="btn_mid ">密码修改</span>
                <span class="btn_rgt"></span>
            </a>
        </div>
        <ul class="lhb_snav1 ft15 mt15 tal">


        </ul>
    </div>       
        <div class="fr" >
            <div sj="click" class="zb_learning">
                <h2 class="lhb_tit1 ft18 mt15">账户设置</h2>
                <ul class="ft14 fwb setting-nav fc mt15">
                    <li class="cur">账户设置</li>
                    <li class="lrnoborder">安全设置</li>
                    <li>第三方账户绑定</li>
                </ul>
                <div class="setting-wrapper">
                    <form style="display: block;" class="setting-person box" id="form1" action="" method="post" name="ajax" >
                        <dl class="zb_form_dl2">
                            <dt>用户名：</dt>
                            <dd>{$userInfo['username']}</dd>
                            <dt>真实姓名：</dt>
                            <dd>
                                <input class="text_input text_wid6" id="realName" name="realName" type="text" value="{$userInfo['truename']}">
                               <!--  <input value="-1" name="sex" id="sex" type="hidden"> -->
                            </dd>
                            <dt>性别：</dt>
                            <dd>
                                <!--<input checked="checked" onclick="$('#sex').val('-1')" class="zb_radio" name="gender" id="genderTxt" type="radio">-->
                                <!--<label class="zb_label" for="genderTxt">保密</label>-->
                                <!--<input onclick="$('#sex').val('1')" class="zb_radio" name="gender" id="genderTxt2" type="radio">-->
                                <!--<label class="zb_label" for="genderTxt2">男</label>-->
                                <!--<input onclick="$('#sex').val('0')" class="zb_radio" name="gender" id="genderTxt3" type="radio">-->
                                <!--<label class="zb_label" for="genderTxt3">女</label>-->

                                <label style="display:inline-block;width: 50px;"><input name="sex" id="sex" value="3" type="radio" <if condition ="$userInfo['sex']=='保密'"> checked = 'checked' </if>> 保密</label>
                                <label style="display:inline-block;width: 40px;"><input name="sex" id="sex" value="1" type="radio" <if condition ="$userInfo['sex']=='男'"> checked = 'checked' </if>> 男</label>
                                <label style="display:inline-block;width: 50px;"><input name="sex" id="sex" value="2" type="radio" <if condition ="$userInfo['sex']=='女'"> checked = 'checked' </if>> 女</label>


                            </dd>
                            <dt>地区：</dt>
                            <dd class="" >
                               <!--  <input value="北京" name="region" id="region" type="hidden">
                                <div style="width:150px" id="s2id_autogen1" class="select2-container sel_input">
                                    <a href="javascript:void(0)" class="select2-choice" tabindex="-1">
                                        <span id="select2-chosen-2" class="select2-chosen">北京</span>
                                        <abbr class="select2-search-choice-close"></abbr>
                                        <span class="select2-arrow" role="presentation">
                                            <b role="presentation"></b>
                                        </span>
                                    </a>
                                    <label for="s2id_autogen2" class="select2-offscreen"></label>
                                    <input id="s2id_autogen2" aria-labelledby="select2-chosen-2" class="select2-focusser select2-offscreen" aria-haspopup="true" role="button" type="text">
                                    <div class="select2-drop select2-display-none select2-with-searchbox">
                                        <div class="select2-search">
                                            <label for="s2id_autogen2_search" class="select2-offscreen"></label>
                                            <input placeholder="" id="s2id_autogen2_search" aria-owns="select2-results-2" autocomplete="off" autocorrect="off" autocapitalize="off" spellcheck="false" class="select2-input" role="combobox" aria-expanded="true" aria-autocomplete="list" type="text">
                                        </div>
                                        <ul id="select2-results-2" class="select2-results" role="listbox">   </ul>
                                    </div>
                                </div>
                                <select title="" tabindex="-1" style="width:150px" class="sel_input select2-offscreen" num="10" onchange="$('#region').val($(this).find('option:selected').text())">

                                <option selected="selected" value="139">北京</option>

                                <option value="158">上海</option>

                                <option value="178">天津</option>

                                <option value="197">重庆</option>

                                <option value="238">黑龙江</option>

                                <option value="252">吉林</option>

                                <option value="262">辽宁省</option>

                                <option value="277">山东</option>

                                <option value="295">山西</option>

                                <option value="307">陕西</option>

                                <option value="318">河北</option>

                                <option value="330">河南</option>

                                <option value="349">湖北</option>

                                <option value="367">湖南</option>

                                <option value="382">海南</option>

                                <option value="401">江苏</option>

                                <option value="415">江西</option>

                                <option value="427">广东</option>

                                <option value="449">广西</option>

                                <option value="464">云南</option>

                                <option value="481">贵州</option>

                                <option value="491">四川</option>

                                <option value="513">内蒙古自治区</option>

                                <option value="526">宁夏回族自治区</option>

                                <option value="532">甘肃</option>

                                <option value="547">青海</option>

                                <option value="556">西藏自治区</option>

                                <option value="564">新疆自治区</option>

                                <option value="583">安徽</option>

                                <option value="601">浙江</option>

                                <option value="613">福建</option>

                                <option value="822">港澳台</option>

                            </select> -->

                            <select id="province" name="province" onchange="getcity()">

                                <option value="默认选择">选择省份</option>

                                <option value="{$userInfo['province']}" selected="">{$userInfo['province']}</option>

                                <option value="北京市">北京市 </option>

                                <option value="广东省">广东省 </option>

                                <option value="上海市">上海市 </option>

                                <option value="天津市">天津市 </option>

                                <option value="重庆市">重庆市 </option>

                                <option>辽宁省</option>

                                <option>江苏省</option>

                                <option>湖北省</option>

                                <option>四川省</option>

                                <option>陕西省</option>

                                <option>河北省</option>

                                <option>山西省</option>

                                <option>河南省</option>

                                <option>吉林省</option>

                                <option>黑龙江</option>

                                <option>内蒙古</option>

                                <option>山东省</option>

                                <option>安徽省</option>

                                <option>浙江省</option>

                                <option>福建省</option>

                                <option>湖南省</option>

                                <option>广西省</option>

                                <option>江西省</option>

                                <option>贵州省</option>

                                <option>云南省</option>

                                <option>西藏</option>

                                <option>海南省</option>

                                <option>甘肃省</option>

                                <option>宁夏</option>

                                <option>青海省</option>

                                <option>新疆</option>

                                <option>香港</option>

                                <option>澳门</option>

                                <option>台湾</option>

                                <option>海外</option>

                                <option>其他</option>

                            </select>

                            
                            </dd>
                            <dt>地址：</dt>
                            <dd class="">
                                <input class="text_input text_wid6" id="address" name="address" onclick="$('#addressError').hide()" type="text" value="{$userInfo['address']}">
                                <span style="display: none" id="addressError">
                                    <em class="lhb_reg_ico2 ml10"></em>
                                    <span id="addressErrorText"></span>
                                </span>
                            </dd>
                            <dt class="w220 pos_z">移动课堂-设备管理：</dt>

                            <dd class="lh24 ft14 gray">
                                如您在手机或者平板电脑安装了酷学直播的客户端，您可以在此取消已绑定的设备，
                                最多可以绑定2台移动设备
                            </dd>


                        </dl>
                        <div class="pop_ct_btn mb20">
                            <span class="btn btn_blue2">
                                <span class="btn_lft"></span>
                                <!--<span class="btn_mid white" onclick="$('#form1').submit()">保 存</span>-->
                                <!-- <button class="btn_mid white ajax">保 存</button> -->
                                <span class="btn_mid white ajax">保 存</span>
                                <span class="btn_rgt"></span>
                            </span>
                        </div>


                    </form>
                    <script>
                        $(function(){
                            $('.ajax').click(function(event) {
                                //阻止表单默认提交事件
                                    // event.preventDefault();
                                var info = $("form[name=ajax]").serialize();
                                $.ajax({
                                    type: "post",
                                    async: false, //同步执行
                                    url: "{:U('Index/Customer/account')}",
                                    data: info,
                                    // dataType:'html',
                                    // traditional:true,
                                    success:function (msg) { 
                                
                                       alert(msg);
                                       // window.location.href = msg.callback;
                                       
                                        
                                    },
                                    error: function () {
                                        alert("网络连接错误，请稍后再试");
                                    }
                                });
                            });

                        });


                    </script>

                    <div style="display: none;" class="safe-setting ft14 hide box">
                        <div class="one">手机绑定设置：<span>135****9718</span>
                            <span>已绑定</span><a href="http://www.koo.cn/account/phone/render/rebind" target="_self" class="blue">修改手机号</a>
                        </div>
                        <div class="one">邮箱绑定设置：<span>823737187@qq.com</span>
                            <span>已绑定</span><a href="http://www.koo.cn/customer/tobindemail" class="blue"><span>修改绑定邮箱</span></a>

                        </div>
                    </div>
                    <div style="display: none;" class="third-setting ft14 fc hide box">

                        <div class="one">
                            <em class="ioc-third-qq"></em>



                            <a href="#" class="blue" onclick="addbind('qq','add')">立即绑定</a>


                        </div>
                        <div class="one">
                            <em class="ioc-third-weixin"></em>



                            <a href="#" class="blue" onclick="addbind('weixin','add')">立即绑定</a>


                        </div>
                        <div class="one">
                            <em class="ioc-third-weibo"></em>



                            <a href="#" class="blue" onclick="addbind('sinaweibo','add')">立即绑定</a>


                        </div>
                        <div class="one">
                            <em class="ioc-third-baidu"></em>



                            <a href="#" class="blue" onclick="addbind('baidu','add')">立即绑定</a>


                        </div>
                    </div>
                </div>
            </div>
        </div>
</div>
</div>

<script>
    function unbind(thirdType,openId){
        var nextPage=$("input[name='next_page']").val();
        var url="/thirdLoginCon/unbind?nextPage="+nextPage+"&uid="+openId+"&type="+thirdType;
        location.href=url;
    }
    function addbind(thirdType,type){
        var nextPage=$("input[name='next_page']").val();
        var kooNextPage='http://www.koo.cn/thirdLoginCon/callBack?bind='+type+'&nextPage='+nextPage;
        var koo_next_url=base64_encode(kooNextPage);
        //var koo_next_url=encodeURIComponent(koo_next);
        var url='http://login.koolearn.com/sso//requestToken.do?koo_next_page='+koo_next_url+'&type='+thirdType+'&f=www_third_denglu';
        location.href=url;
    }

    $(function(){
        $(".zb_learning").ontabs(".setting-nav li",".setting-wrapper > .box","cur","click");
    });
    function base64_encode(str){
        var c1, c2, c3;
        var base64EncodeChars = "ABCDEFGHIJKLMNOPQRSTUVWXYZabcdefghijklmnopqrstuvwxyz0123456789+/";
        var i = 0, len= str.length, string = '';

        while (i < len){
            c1 = str.charCodeAt(i++) & 0xff;
            if (i == len){
                string += base64EncodeChars.charAt(c1 >> 2);
                string += base64EncodeChars.charAt((c1 & 0x3) << 4);
                string += "==";
                break;
            }
            c2 = str.charCodeAt(i++);
            if (i == len){
                string += base64EncodeChars.charAt(c1 >> 2);
                string += base64EncodeChars.charAt(((c1 & 0x3) << 4) | ((c2 & 0xF0) >> 4));
                string += base64EncodeChars.charAt((c2 & 0xF) << 2);
                string += "=";
                break;
            }
            c3 = str.charCodeAt(i++);
            string += base64EncodeChars.charAt(c1 >> 2);
            string += base64EncodeChars.charAt(((c1 & 0x3) << 4) | ((c2 & 0xF0) >> 4));
            string += base64EncodeChars.charAt(((c2 & 0xF) << 2) | ((c3 & 0xC0) >> 6));
            string += base64EncodeChars.charAt(c3 & 0x3F)
        }
        return string;
    }

</script>
<script>
    loadform();
</script>
<script type="text/javascript">
    function valid(){
        var address = $('#address').val();
        if(address != '' && address.length < 5){
            $('#addressError').show();
            $('#addressErrorText').text('地址不能少于五个字');
            return false
        }
        return true;
    }
</script>
